package com.smartlifev30.baiwei.activity;

import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.Toast;

import com.smartlifev30.R;
import com.smartlifev30.baiwei.adapter.SceneAdapter;
import com.smartlifev30.baiwei.view.recyclerViewComponent.GridItemDivider;
import com.smartlifev30.mvp.presenter.BasePresenter;

import java.util.ArrayList;

/**
 * @author tys
 */
public class SceneActivity extends BaseActivity {

    private RecyclerView recyclerView;
    private SceneAdapter sceneAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scene);
        initView();
    }

    private void initView() {
        recyclerView = findViewById(R.id.scene_recycler_view);
        recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
        recyclerView.addItemDecoration(new GridItemDivider(this));
        sceneAdapter = new SceneAdapter(this, new ArrayList<>());
        sceneAdapter.setItemClickListen((itemView, position) -> {
            Toast.makeText(SceneActivity.this, position + "", Toast.LENGTH_SHORT).show();
        });
        recyclerView.setAdapter(sceneAdapter);
    }

    @Override
    protected BasePresenter createPresent() {
        return null;
    }
}
